#import <UIKit/UIKit.h>

#import "FWApplication.h"
#import "FWListViewDelegate.h"
#import "FWApplicationDelegate.h"
#import "FWPreferences.h"

extern "C" CFStringRef UIDateFormatStringForFormatType(CFStringRef type);

#define localize(bundle, str) [bundle localizedStringForKey:str value:str table:nil]
#define localizeGlobal(str) [self.plugin.globalBundle localizedStringForKey:str value:str table:nil]


@class LIPlugin;
@class SBApplication;
@class FWToolbarViewCell;


@interface FWPlugin : NSObject <LIPluginController, LITableViewDelegate, UITableViewDataSource> 
{
    id<FWListViewDelegate> datasource;
    FWApplication* application;
    NSDate* lastUpdate;
    
    FWToolbarViewCell* toolbarView;
}


@property (retain) LIPlugin* plugin;
@property (nonatomic, retain) NSDate* lastUpdate;
@property (retain) NSArray* items;
@property (retain) FWApplication* application;
@property (retain) id<FWListViewDelegate> datasource;
@property (nonatomic, retain) FWPreferences* preferences;
@property BOOL showToolbar;


- (id)initWithApplication:(FWApplication*)app;
- (void)dealloc;

- (void) updateTasks;

- (void)triggerRedisplay;
- (void)triggerUnconditionalRefresh;

- (void)setBadgeValue:(NSString*)value hidden:(BOOL)hidden;

@end
